
'use strict';
// 收益 记录表
module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, STRING, DATE, ENUM } = Sequelize;
    // 创建表
    await queryInterface.createTable('profit', {
      id: {
        type: INTEGER(30).UNSIGNED,
        primaryKey: true,
        autoIncrement: true
      },
      type:{
        type: ENUM,
        values: ['shop', 'wxuser'],
        allowNull: false,
        defaultValue: 'shop',
        comment: '类型 shop商家  wxuser代理 '
      },
      type_id:{
          type:INTEGER(30),
          allowNull:false,
          defaultValue:0,
          comment:'商家 代理 id'
      },
      content:{
        type: STRING(2000),
        allowNull: false,
        defaultValue: '0',
        comment: '内容',
      },
      price:{
        type: STRING(200),
        allowNull: false,
        defaultValue: '',
        comment: '交易金额',
      },
      created_at: DATE,
      updated_at: DATE,
    });
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.dropTable('profit');
  }
};